package codeRandomThoughts.Test226翻转二叉树;

import codeRandomThoughts.utils.TreeNode;

public class Solution {
    public TreeNode invertTree(TreeNode root) {
        invert(root);
        return root;
    }

    public void invert(TreeNode root){
        if (root == null){
            return;
        }
        TreeNode tem = root.left;
        root.left = root.right;
        root.right = tem;
        invert(root.left);
        invert(root.right);
    }
}
